<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<link rel="stylesheet" type="text/css" href="style/tip.css" />
<script language="javascript" type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
<title>咨询反馈</title>
</head>
<style type="text/css">
.pointer{
	cursor:pointer;
}
</style>
<body>
<?php //var_dump($allfeedback);?>
<div id="wrap">
<div id="public_head"></div>
<div class="m_search">
<form action='' method='post'>按科室<select class="select" name="dep">
        		<?php 
        			if(is_array($alldep) && count($alldep)>0){
						echo "<option value='0'>所有科室</option>";
        				foreach ($alldep as $k=>$v){        	
        		?>
        			<option value='<?php echo $k;?>'
		<?php if($k==$dep)echo ' selected';?>><?php echo $v;?></option>
        	<?php 
        				}
        			}else{
        				echo "<option value='0'>请先添加科室</option>";
        			}
        	?>
				 </select> 反馈人<input class="qi_text" name="name" type="text"
	value="<?php echo $name;?>" /> 
	起止时间 <input class="Wdate" type="text" name='bt' value="<?php echo $begtime;?>" onClick="WdatePicker()"> 
            > <input class="Wdate" type="text" name='et' value="<?php echo $endtime;?>" onClick="WdatePicker()">  
	处理状态<select class="select" name="state">
	<option value='0'>所有状态</option>
				<?php 
					if(is_array($states) && count($states)>0){
						foreach ($states as $k=>$v) {
				?>
						<option value='<?php echo $k?>'
		<?php if($k==$state)echo ' selected ';?>><?php echo $v?></option>
				<?php 
						}
					}
				?>
	</select> 类型<select class="select" name="type">
	<option value='0'>所有类型</option>
			 	<?php 
			 		foreach ($types as $k=>$v){
			 	?>
			 		<option value="<?php echo $k;?>"
		<?php if($k==$type)echo ' selected';?>><?php echo $v;?></option>
			 	<?php 
			 		}
			 	?>
			 	</select> <input class="btn_search" name="back_sel" type="submit"
	value="" /></form>
</div>
<div class="m_content">
<table class="qi_table" width="0" border="0" cellpadding="0"
	cellspacing="1">
	<tr>
		<th>反馈人姓名</th>
		<th>反馈内容</th>
		<th>反馈时间</th>
		<th>反馈类型</th>
		<th>科室</th>
		<th>处理状态</th>
		<th>处理时间</th>
		<th>处理人</th>
		<th>操作</th>
	</tr>
              <?php 
              	if(is_array($allfeedback) && count($allfeedback)>0){
              		foreach ($allfeedback as $v){
              ?>
              <tr>
		<td><?php echo str_replace($name,'<font color=red><b>'.$name.'</b></font>&nbsp;',$v['NAME'])?></td>
		<td style="text-align: left;"><?php
																echo ATools::msubstr($v['CONTENT'],0,33)?></td>
		<td><?php
																echo $v ['FEED_TIME']?></td>
		<td><?php
																echo $types [$v ['TYPE']]?></td>
		<td><?php
																echo $alldep [$v ['DEP_NO']]?></td>
		<td><b class="greenword"><?php
																echo $states [$v ['STATE']]?></b></td>
		<td><?php
																echo $v ['UPD_TIME']?></td>
		<td><?php
																echo ATools::retUserTrueName($v ['UPD_USER'])?></td>
		<td>
			<?php 
				if($v['STATE']<3){
			?>
					<a onclick="T.setCookie('goback_feedback','<?php echo $_SERVER['REQUEST_URI']?>')" href="/index.php?c=feed&a=lookfeedback&id=<?php echo $v['F_ID']?>">查看</a> 
			<?php }else{?>
					<a href="/index.php?c=feed&a=lookfeedback&id=<?php echo $v['F_ID']?>&pid=2" onclick="T.setCookie('goback_feedback','<?php echo $_SERVER['REQUEST_URI']?>');">回复</a> 
			<?php }?>
			<a href="" class='pass pointer' passid='4' pid='<?php echo $v['F_ID']?>'><font color='gray'>通过</font></a> 
			<a href="" class='pass pointer' passid='5' pid='<?php echo $v['F_ID']?>'><font color='gray'>不通过</font></a>
			<a href="javascript:editFeedback('?c=feed&a=editfeed&id=<?php echo $v['F_ID']?>')"><font color='gray'>编辑</font></a>
	        <a href="?c=feed&a=delfeed&id=<?php echo $v['F_ID']?>" onclick="if(T.confirm('确认删除吗？')){return true;}else{return false;}"><font color='gray'>删除</font></a>
		</td>
	</tr>
              <?php 
              		}
              	}else{
              ?>
               <tr height="40">
		<td style="text-align: center; color: green;" colspan='10'>没有您搜索的结果</td>
	</tr>
               <?php }?>
              <tr>
		<td colspan='10'>
					<?php 
						$url = '/index.php?c='.$_REQUEST['c'].'&a='.$_REQUEST['a'].'&p=_num_&dep='.$dep.'&name='.urlencode($name).'&bt='.$begtime.'&et='.$endtime.'&state='.$state.'&type='.$type;
						echo JYTools::pager($url,$tolNum,$page,$pagesize);
					?>
			  </td>
	</tr>
</table>
</div>
</div>
</body>
</html>
<script src="/js/xheditor/jquery/jquery-1.4.4.min.js"></script>
<script src="js/artDialog/jquery.artDialog.js?skin=chrome"></script>
<script src="js/artDialog/plugins/iframeTools.source.js"></script>
<script src="js/comm.js" type="text/javascript"></script>
<script src="/js/boot.js"></script>
<script src="/js/tip.js"></script>
<script src="/js/add_public_head.js" type="text/javascript"></script>
<script type="text/javascript">
$('.pass').click(function (){
	var t = this
	if(T.confirm('确认操作吗？')){
		$.ajax({
			url:'/index.php',
			data:{'c':'feed','a':'passFeedback','p':$(t).attr('passid'),'id':$(t).attr('pid')},
			type:'get',
			dataType:'json',
			success:(function(de){
				T.addtip(t,lang[de.msg]);
				location.reload()
			})
		})
	}
	return false;
})
$('input[name="sub_ask"]').click(function(){
	var depid = $('select[name="depid"]').val()
	var type = $('input[name="type"]').val()
	var title = $('input[name="title"]').val()
	var con = $('textarea[name="content"]').val()
	if(title == ''){
		$('#msg').html('标题不能为空')
		return false;
	}
	if(con == ''){
		$('#msg').html('咨询内容不能为空')
		return false;
	}
	$.ajax({
		url:'<?php echo $_SERVER['REQUEST_URI']?>',
		data:{'depid':depid,'type':type,'title':title,'content':con},
		type:'post',
		dataType:'json',
		success:(function(de){
			$('#msg').html(lang[de.msg])
		})
	})
})
function editFeedback(url) {
	JYCsm.openWindow(encodeURI(url), 
	{width: 700,height:350, id: 'visit-info-dlg',title:'编辑反馈内容'});
}
$('input[name="back_sel"]').click(function(){
	var now = new Date();
    var year = now.getFullYear();       //年
    var month = now.getMonth() + 1;     //月
    if(month<10){
		month = '0'+month
    }
    var day = now.getDate();  
    var nowday = year+'-'+month+'-'+day;
	if($('input[name="et"]').val() < $('input[name="bt"]').val()){
		alert('结束日期不能小于开始日期')
		return false;
	}
	if($('input[name="et"]').val() > nowday){
		alert('结束日期不能大于当天日期')
		return false;
	}
	return true;
})
</script>